<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="${path}/css/main.css">
		<link rel="stylesheet" type="text/css" href="${path}/css/mainTable.css">
		<script type="text/javascript">
			function remove(id,login_username){
				if(confirm("删除后无法恢复!你确定要删除吗?")){
					var actionUrl = "${path}/userInfo/deleteUserInfo.action";
					var params = "userInfoVo.id="+id+"&userInfoVo.login_username="+login_username;
					params = encodeURI(params);
					params = encodeURI(params);
					window.location.href = actionUrl+'?'+params;
				}
			}
		</script>
	</head>
	<body>
		<div>
			<p>
				新加用户信息<a href="${path}/userInfo/addUserInfo.action" title="添加用户信息">添加</a>
			</p>
			<table>
				<thead>
					<tr>
						<th>用户编码</th>
						<th>用户名</th>
						<th>用户地址</th>
						<th>手机号码</th>
						<th>邮箱</th>
						<th>角色</th>
						<th>操作</th>
					</tr>
				</thead>
				<c:choose>
					<c:when test="${userInfoVoList != null && fn:length(userInfoVoList) > 0}">
						<c:forEach var="userInfoVo" items="${userInfoVoList }" varStatus="list">
							<tr style="${list.index%2 != 0 ? 'background-color: #fea;' : 'background-color: #fff;' }">
								<td>${userInfoVo.id }</td>
								<td>
									<a href="${path}/userInfo/editUserInfo.action?userInfoVo.id=${userInfoVo.id }" title="编辑">${userInfoVo.login_username }</a>
								</td>
								<td>${path }/login/loginPartner.action?key=${userInfoVo.user_key }</td>
								<td>${userInfoVo.mobile }</td>
								<td>${userInfoVo.email }</td>
								<td>
									<c:if test="${userInfoVo.category == 0 }">超级管理员</c:if>
									<c:if test="${userInfoVo.category == 1 }">渠道管理员</c:if>
									<c:if test="${userInfoVo.category == 5 }">普通用户</c:if>
								</td>
								<td>
									<a href="javascript:remove(${userInfoVo.id },'${userInfoVo.login_username }');">删除</a>
								</td>
							</tr>
						</c:forEach>
					</c:when>
					<c:otherwise>
		    			<tr>
		    				<td>暂无用户信息</td>
		    			</tr>
		    		</c:otherwise>
				</c:choose>
			</table>
		</div>
	</body>
</html>